package com.bzr.emos.wx.controller;

import com.bzr.emos.wx.Service.LoginService;
import com.bzr.emos.wx.common.util.R;
import com.bzr.emos.wx.config.security.LoginDTO;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
public class RestLoginController {



    @Resource
    private LoginService loginService;





    @CrossOrigin
    @PostMapping("/login")
    public R login(@RequestBody LoginDTO loginDTO, HttpServletResponse response) {


        return loginService.checkLogin(loginDTO,response);


    }




}
